package com.bo.Entity;


import java.io.InputStream;
import java.io.OutputStream;

public class MyImage {
	
	private int id;
	private String imageName;
	private long size;
	private boolean notNull;
	private InputStream inputStream;
	private OutputStream outputStream;
    public MyDimension dimension;

	public MyImage() {
		super();
	}


	public MyImage(int id, OutputStream outputStream) {
		super();
		this.id = id;
		this.outputStream = outputStream;
	}
	
	public MyImage(int id, OutputStream outputStream,Integer width,Integer height) {
		super();
		this.id = id;
		this.outputStream = outputStream;
		
		if(width!=null && height!=null){
			
		    this.dimension=new MyDimension(width,height);
		}
	}



	public MyImage(int id,String imageName) {
		super();
		this.id=id;
		this.imageName = imageName;
	}
	
	
	public MyImage(int id,String imageName,InputStream inputStream) {
		super();
		this.id=id;
		this.imageName = imageName;
		this.inputStream = inputStream;
	}
	
	public MyImage(int id, String imageName, long size, InputStream inputStream) {
		super();
		this.id=id;
		this.imageName = imageName;
		this.size = size;
		this.notNull=true;
		this.inputStream = inputStream;
	}
	
	
	public MyImage(int id, InputStream inputStream) {
		super();
		
		this.id=id;
		this.imageName = "";
		this.size = 0;
		this.notNull=false;
		this.inputStream = inputStream;
	}

	
	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}
	
	public String getImageName() {
		return imageName;
	}

	public void setImageName(String imageName) {
		this.imageName = imageName;
	}

	public long getSize() {
		return size;
	}
	public void setSize(long size) {
		this.size = size;
	}

	public InputStream getInputStream() {

		return inputStream;
	}
	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public OutputStream getOutputStream() {
		return outputStream;
	}


	public void setOutputStream(OutputStream outputStream) {
		this.outputStream = outputStream;
	}
	
	public boolean isNotNull() {
		return notNull;
	}

	public void setNotNull(boolean notNull) {
		this.notNull = notNull;
	}

	public void setMyDimension(int width,int height){
		
		this.dimension=new MyDimension(width,height);
	}
	
	@Override
	public String toString(){
		
		return getImageName();
	}
	
	
	public class MyDimension{
		public int width;
		public int height;
		
		public MyDimension(int width, int height) {
			super();
			this.width = width;
			this.height = height;
		}
	
	}
}
